<?php
/**
 * Created by PhpStorm.
 * User: sunshubo
 * Date: 2017/12/12
 * Time: 9:49
 */

class GetActiveDetail_control extends MY_Controller
{
    function index()
    {
        $body = $_POST;
        if (!$body) {
            $body = $this->input->raw_input_stream;
        }
        $body = str_replace('\n', '<br>', $body);
        $body = str_replace(' ', '&nbsp;', $body);
        $body = json_decode($body);
        $this->load->model('active/GetActiveDetail_model', 'getInfo');
        $res = $this->getInfo->get_active_detail($body->id);
//        $data = array('msg' => 'ok', 'result' => SUCCESS);
//        $data['title'] = $res['title'];
//        $data['data'] = $res['data'];
//        $data['share'] = $res['share_total'];
//        $data['look'] = $res['look_total'];
//        $data['join'] = $res['join_total'];
//        echo json_encode($data);
        if ($res) {
            echo json_encode(array('msg' => 'ok', 'resutl' => SUCCESS, 'list' => $res));
        } else {
            echo json_encode(array('msg' => 'err', 'resutl' => ERROR));
        }
    }
}